#include "small_widget.h"
#include "ui_small_widget.h"


small_widget::small_widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::small_widget)
{
    ui->setupUi(this);

    //QSpinBox移动，Qslider跟着动
    //valuechanged重构函数  需要确定是哪一个
    void(QSpinBox::*spSignal)(int) = &QSpinBox::valueChanged;
    connect(ui->spinBox,spSignal,ui->horizontalSlider,&QSlider::setValue);
    //Qslider移动，QSpinBox跟着动
    connect(ui->horizontalSlider,&QSlider::valueChanged,ui->spinBox,&QSpinBox::setValue);
}
int small_widget::getvalue(){
    return ui->horizontalSlider->value();
}
void small_widget::setvalue(int num){
    ui->horizontalSlider->setValue(num);
}
small_widget::~small_widget()
{
    delete ui;
}
